package com.metadata_system.common.db.entity;

import java.util.Date;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Table(name = "md_chat_message")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ChatMessage {
    @Id
    private Integer id;

    /**
     * 会话ID
     */
    @Column(name = "chat_id")
    private Integer chatId;

    /**
     * 用户ID
     */
    @Column(name = "user_id")
    private Integer userId;

    /**
     * 提问
     */
    private String ask;

    /**
     * 回答ID
     */
    @Column(name = "answer_id")
    private Integer answerId;

    /**
     * 回答耗时(秒数)
     */
    @Column(name = "answer_seconds")
    private Short answerSeconds;

    /**
     * 回答时间
     */
    @Column(name = "answer_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date answerTime;

    /**
     * 发送时间
     */
    @Column(name = "created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;
}